open-with: add a public _refresh() method
authorCosimo Cecchi <cosimoc@gnome.org>
Mon, 22 Nov 2010 22:02:57 +0000 (23:02 +0100)
committerCosimo Cecchi <cosimoc@gnome.org>
Tue, 23 Nov 2010 15:53:22 +0000 (16:53 +0100)
This can be useful now that we're splitting some items from the widget.

gtk/gtkopenwith.c
gtk/gtkopenwith.h
gtk/gtkopenwithdialog.c
gtk/gtkopenwithprivate.h
gtk/gtkopenwithwidget.c

index e5123b0726c4eebab9481a7759f2c24c400ce016..0bd4c1ace5a3805e9485cea190f260f9f90332f0 100644 (file)
@@ -66,3 +66,9 @@ gtk_open_with_get_app_info (GtkOpenWith *self)
 {
   return GTK_OPEN_WITH_GET_IFACE (self)->get_app_info (self);
 }
+
+void
+gtk_open_with_refresh (GtkOpenWith *self)
+{
+  GTK_OPEN_WITH_GET_IFACE (self)->refresh (self);
+}
index 09bca2f4000c89854f5be35ec40d207229430645..c77029b5e6e95a8d8237226ac7aa053032bd61ab 100644 (file)
@@ -46,6 +46,7 @@ GType gtk_open_with_get_type () G_GNUC_CONST;
 
 GAppInfo * gtk_open_with_get_app_info (GtkOpenWith *self);
 gchar * gtk_open_with_get_content_type (GtkOpenWith *self);
+void gtk_open_with_refresh (GtkOpenWith *self);
 
 G_END_DECLS
 
index 596b06a107f8cc645abf399eeb44dc08f4d3a468..12d93b341a024ca65e538dd7f9606a4a330df5be 100644 (file)
@@ -106,7 +106,7 @@ search_for_mimetype_ready_cb (GObject *source,
     }
   else
     {
-      _gtk_open_with_widget_refilter (GTK_OPEN_WITH_WIDGET (self->priv->open_with_widget));
+      gtk_open_with_refresh (GTK_OPEN_WITH (self->priv->open_with_widget));
     }
 
   g_object_unref (online);
@@ -417,6 +417,14 @@ gtk_open_with_dialog_get_app_info (GtkOpenWith *object)
   return app;
 }
 
+static void
+gtk_open_with_dialog_refresh (GtkOpenWith *object)
+{
+  GtkOpenWithDialog *self = GTK_OPEN_WITH_DIALOG (object);
+
+  gtk_open_with_refresh (GTK_OPEN_WITH (self->priv->open_with_widget));
+}
+
 static void
 gtk_open_with_dialog_constructed (GObject *object)
 {
@@ -496,6 +504,7 @@ static void
 gtk_open_with_dialog_iface_init (GtkOpenWithIface *iface)
 {
   iface->get_app_info = gtk_open_with_dialog_get_app_info;
+  iface->refresh = gtk_open_with_dialog_refresh;
 }
 
 static void
index c25b487b6e69be8bc02b5cef45020a874b7144b4..a4205ec51b8881d0da5c265ea6d3dcffce678b0b 100644 (file)
@@ -39,8 +39,7 @@ struct _GtkOpenWithIface {
   GTypeInterface base_iface;
 
   GAppInfo * (* get_app_info) (GtkOpenWith *object);
+  void       (* refresh)      (GtkOpenWith *object);
 };
 
-void _gtk_open_with_widget_refilter (GtkOpenWithWidget *self);
-
 #endif /* __GTK_OPEN_WITH_PRIVATE_H__ */
index cfe6c97f6d4c0c86b08acafb7d353350a9d74084..8edeb6d8a4820f49669835d1d3e3011110ca56f4 100644 (file)
@@ -197,7 +197,7 @@ item_forget_association_cb (GtkMenuItem *item,
        g_app_info_remove_supports_type (info, self->priv->content_type, NULL);
     }
 
-  _gtk_open_with_widget_refilter (self);
+  gtk_open_with_refresh (GTK_OPEN_WITH (self));
 }
 
 static GtkWidget *
@@ -1061,16 +1061,9 @@ gtk_open_with_widget_get_app_info (GtkOpenWith *object)
 }
 
 static void
-gtk_open_with_widget_iface_init (GtkOpenWithIface *iface)
-{
-  iface->get_app_info = gtk_open_with_widget_get_app_info;
-}
-
-void
-_gtk_open_with_widget_refilter (GtkOpenWithWidget *self)
+gtk_open_with_widget_refresh (GtkOpenWith *object)
 {
-
-  gtk_open_with_widget_ensure_show_more_button (self);
+  GtkOpenWithWidget *self = GTK_OPEN_WITH_WIDGET (object);
 
   if (self->priv->program_list_store != NULL)
     {
@@ -1085,6 +1078,13 @@ _gtk_open_with_widget_refilter (GtkOpenWithWidget *self)
     }
 }
 
+static void
+gtk_open_with_widget_iface_init (GtkOpenWithIface *iface)
+{
+  iface->get_app_info = gtk_open_with_widget_get_app_info;
+  iface->refresh = gtk_open_with_widget_refresh;
+}
+
 GtkWidget *
 gtk_open_with_widget_new (const gchar *content_type)
 {